]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inputMethod: Keep Capabilite.FOCUS before context.focus_in/focus_out
authorTakao Fujiwara <tfujiwar@redhat.com>
Wed, 1 Mar 2023 14:42:18 +0000 (23:42 +0900)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 8 Aug 2023 10:20:28 +0000 (10:20 +0000)
If context.focus_out() is called *after* context.set_capabilities(0),
The FocusOut D-Bus method is ignored because of no FOCUS capability.
If context.focus_out() is called *before* context.set_capabilities(0),
The 0 capability is set to the next focused context and the
FocusIn D-Bus method is ignored because of no FOCUS capability.
So context.set_capabilities(0) should not be called.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6415
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2666>

js/misc/inputMethod.js

index aabd280c85dc37e53d2631c795e8dea8d67f9968..d944c29784f6949dd2ef24230591f8b5775772e2 100644 (file)
@@ -188,6 +188,7 @@ export const InputMethod = GObject.registerClass({
     vfunc_focus_in(focus) {
         this._currentFocus = focus;
         if (this._context) {
+            this.update();
             this._context.focus_in();
             this._emitRequestSurrounding();
         }
@@ -371,7 +372,6 @@ export const InputMethod = GObject.registerClass({
     _fullReset() {
         this._context.set_content_type(0, 0);
         this._context.set_cursor_location(0, 0, 0, 0);
-        this._context.set_capabilities(0);
         this._context.reset();
     }